
import sys
import dicom
import dicom_dao
import json

filename = sys.argv[1]

try:
    dcmfile = dicom.read_file(filename, force=True )
except:
    print "DICOM not readable"
    raise

dicomJson = dicom_dao.pydicom2json(dcmfile)
jsdmp = json.dumps(dicomJson[0])

print jsdmp
